<template>
  <div class="app-container tableList">
    <div
      style="height: 200px;font-size: 9px;"
    >
      <p style="margin: 1px 2px 1px 0;">食品名称：{{ CookieTemplateList.foodName}}</p>
      <p style="margin: 1px 2px 1px 0;width: 99mm;">配料表：{{ CookieTemplateList.ingredient}}</p>
      <!-- <p style="margin: 1px 0;">净含量：{{ CookieTemplateList.netContent}}</p> -->
      <p style="margin: 1px 2px 1px 0;display: flex;justify-content: space-between;width: 98mm;">
        <span>净含量：{{ CookieTemplateList.netContent}}</span>
        <span>生产日期：{{ getNowTime }}</span>
        <span>贮存条件：{{ CookieTemplateList.storageConditions}}</span>
      </p>
      <p style="margin: 1px 2px 1px 0;display: flex;justify-content: space-between;width: 98mm;">
        <span>产品类别：{{ CookieTemplateList.productCategory}}</span>
        <span>加工方式：{{ CookieTemplateList.processingMode}}</span>
        <span>保质期：{{ CookieTemplateList.term}}</span>
      </p>
      <p style="margin: 1px 2px 1px 0;width: 99mm;">生产商：{{ CookieTemplateList.salesOrganizationName}}</p>
      <p style="margin: 1px 2px 1px 0;width: 99mm;">地址：{{ CookieTemplateList.warehouseAddress}}</p>
      <!-- <p style="margin: 1px 0;display: flex;justify-content: space-between;">
        <span>联系方式：{{ CookieTemplateList.contactInformation}}</span>
        <span>食品生产许可证编号：{{ CookieTemplateList.licence}}</span>
      </p> -->
      <div style="display: flex;justify-content: space-between;">
        <p style="margin: 1px 0;width: 61%;display: flex;flex-direction: column;margin-right: 1%;">
          <span>联系方式：{{ CookieTemplateList.contactInformation}}</span>
          <span>食品生产许可证编号：{{ CookieTemplateList.licence}}</span>
          <span>产品实行标准：{{ CookieTemplateList.executiveStandards}}</span>
          <span>致敏物提示：{{ CookieTemplateList.sensitizerTips}}</span>
          <span>食用方法：{{ CookieTemplateList.edibleMethods}}</span>
        </p>
        <!-- <p style="margin: 1px 0;">产品实行标准：{{ CookieTemplateList.standard}}</p> -->
        <!-- <p style="margin: 1px 0;">致敏物提示：{{ CookieTemplateList.Sensitizer}}</p> -->
        <table cellspacing="0" style="border-collapse: collapse;border-collapse: collapse;border: solid 1px #000;width: 36%;margin-right: 2%;">
          <tr style="line-height: .7;">
            <td :colspan="3" style="border: solid 1px #000;padding: 3px;font-size: 9px;width: 100%;">营养成分表</td>
          </tr>
          <tr style="line-height: .3;">
            <td style="border: solid 1px #000;padding: 3px;font-size: 6px;width: 30%;">项目</td>
            <td style="border: solid 1px #000;padding: 3px;font-size: 6px;width: 47%;">每100克（g）</td>
            <td style="border: solid 1px #000;padding: 3px;font-size: 6px;width: 23%;">NRV%</td>
          </tr>
          <tr v-for="(Nutrients,Nutindex) in CookieTemplateList.goodsSkuProductionNutrientsList" :key="Nutindex" style="line-height: .3;">
            <td style="border-left: solid 1px #000;padding: 3px;font-size: 6px;width: 30%;">{{ Nutrients.item }}</td>
            <td style="font-size: 6px;width: 47%;">{{ Nutrients.content }}</td>
            <td style="border-right: solid 1px #000;font-size: 6px;width: 23%;">{{ Nutrients.percentage }}</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
import QRCode from "qrcodejs2";
export default {
  props: {
    CookieTemplateList: {
      required: true,
    },
  },
  data() {
    return {
      getNowTime: ''
    };
  },
  created() {
    this.getDate()
  },
  mounted() {
    // console.log(this.orderGoodriesList,'02')
    // console.log('this.orderGoodriesList',this.orderGoodriesList)
    // if(this.$refs.qrCodeDiv) {
    //   this.$nextTick(function () {
    //     this.creatQrCode();
    //     console.log('this.orderGoodriesList',this.orderGoodriesList)
    //   })
    // }
  },
  watch: {},
  methods: {
    getDate() {
      let nowYear = new Date().getFullYear();
      let nowMonth = (new Date().getMonth() + 1) < 10 ? "0" + (new Date().getMonth() + 1) : (new Date().getMonth() +
        1);
      let nowDate = new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate();
      let nowHours = new Date().getHours() < 10 ? "0" + new Date().getHours() : new Date().getHours();
      let nowMinutes = new Date().getMinutes() < 10 ? "0" + new Date().getMinutes() : new Date().getMinutes();
      // console.log(e.currentTarget.dataset.time,nowYear + '-' + nowMonth + '-' + nowDate + ' ' + nowHours + ':' + nowMinutes)
      let nowTime = nowYear + '年' + nowMonth + '月' + nowDate + '日';
      this.getNowTime = nowTime;
      // console.log('',this.CookieTemplateList.manufactureDate)
    }
  },
};
</script>

<style lang='scss'>
.app-container {
  .ordermain {
    p {
      font-size: 10px;
      line-height: 0.8;
    }
  }
}
</style>
